cmake_minimum_required(VERSION 3.0.0)
project(main VERSION 0.1.0)


find_package(Boost REQUIRED)

if(NOT TARGET hiredis)
    add_subdirectory(3rdParty/hiredis)
endif()


file(GLOB_RECURSE SRCS ${CMAKE_SOURCE_DIR}/src/*.*)
file(GLOB_RECURSE HEADS ${CMAKE_SOURCE_DIR}/src/*.h ${CMAKE_SOURCE_DIR}/src/*.hpp)
file(COPY ${HEADS} DESTINATION ${CMAKE_SOURCE_DIR}/include)

include_directories(
    ${CMAKE_SOURCE_DIR}/include 
    ${Boost_INCLUDE_DIR}
    ${CMAKE_SOURCE_DIR}/3rdParty/hiredis
)

add_executable(easyWebServer ${SRCS})

target_link_libraries(easyWebServer pthread ${Boost_LIBRARIES} hiredis)

install(FILES ${CMAKE_SOURCE_DIR}/config/config.conf DESTINATION /etc/easyWebServer/)

